package lesson5_2;

public class Demo1 extends Object{
    public static void main(String[] args) throws CloneNotSupportedException {
        Driver driver1 = new Driver("张三",20);
        //Person类型有可能不支持克隆

        Driver driver2 = (Driver) driver1.clone();
        System.out.println(driver2);
        System.out.println(driver1 == driver2);
        driver1.setName("李四");
        System.out.println(driver2);

    }
}
